home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / DOCZ16.ZIP;1 / DOCZ.LIF / C.TXT < prev    next >
Encoding:
Text File  |  1994-04-24  |  34.6 KB  |  2,435 lines

  1. ACCESS
  2.  
  3. C
  4.  
  5. SYSTEM
  6.  
  7. determine accessibility of a file
  8.  
  9. 0 on success
  10. non-zero on failure with errno indicating:
  11. [ENOTDIR]   A component of the path prefix is not a directory.
  12.  
  13. [ENOENT]    If the named file does not exist or the path argument
  14.             points to an empty string.
  15.  
  16. [EACCES]    A component of the path prefix denies search permission,
  17.             or the permission bits of the file mode do not permit the
  18.             requested access.
  19.  
  20. [EROFS]     Write access is requested for a file on a read-only file
  21.             system.
  22.  
  23. [ETXTBSY]   Write access is requested for a pure procedure (shared
  24.             text) file that is being executed.
  25.  
  26. [EFAULT]    path points outside the allocated address space for the
  27.             process.
  28.  
  29. [EINTR]     A signal was caught during the access system call.
  30.  
  31. [ENOLINK]   path points to a remote machine and the link to that machine
  32.             is no longer active.
  33.  
  34. [EMULTIHOP] Components of path require hopping to multiple remote
  35.             machines.
  36.  
  37. [ENAMETOOLONG] (POSIX Only)  The length of the path argument exceeds
  38.             {PATH_MAX}, or a path name component is longer than {NAME_MAX} while
  39.             {_POSIX_NO_TRUNC} is in effect.
  40.  
  41. int access (path,amode);
  42.    char *path;    /* (r) file specification */
  43.    int amode;     /* (r) access mode */
  44.  
  45. ALARM
  46.  
  47. C
  48.  
  49. SYSTEM
  50.  
  51. set a process alarm clock
  52.  
  53. The alarm system call returns the amount of time previously remaining
  54. in the alarm clock of the calling process.
  55.  
  56. unsigned alarm (sec)
  57.    unsigned sec;     /* (r) number of seconds to timeout */
  58.  
  59. BRK
  60.  
  61. C
  62.  
  63. MEMORY
  64.  
  65. change data segment space allocation
  66.  
  67. 0 on success, -1 on failure with errno indicating the error:
  68.  
  69. [ENOMEM]    Such a change would result in more space being allocated
  70.             than is allowed by the system-imposed maximum process size.
  71.  
  72. [EAGAIN]    Total amount of system memory available for a read during
  73.             physical IO is temporarily insufficient [see shmop(2)].  This may
  74.             occur even though the space requested was less than the
  75.             system-imposed maximum process size.
  76.  
  77. int brk(endds)
  78.    char *endds;   /* (r) break value to set */
  79.  
  80. SBRK
  81.  
  82. C
  83.  
  84. MEMORY
  85.  
  86. change data segment space allocation
  87.  
  88. The previous break value on success, -1 on error with errno
  89. indicating the error:
  90. [ENOMEM]    Such a change would result in more space being allocated
  91.             than is allowed by the system-imposed maximum process size.
  92.  
  93. [EAGAIN]    Total amount of system memory available for a read during
  94.             physical IO is temporarily insufficient [see shmop(2)].  This may
  95.             occur even though the space requested was less than the
  96.             system-imposed maximum process size.
  97.  
  98. char *sbrk(incr)
  99.    int incr;      /* (r) increment or decrement to break value */
  100.  
  101. CHDIR
  102.  
  103. C
  104.  
  105. SYSTEM
  106.  
  107. change working directory
  108.  
  109. 0 on success, non-zero on failure
  110.  
  111. int chdir(path)
  112.    char *path;    /* (r) new working directory */
  113.  
  114. CHMOD
  115.  
  116. C
  117.  
  118. SYSTEM
  119.  
  120. change mode of file
  121.  
  122. 0 on success, non-zero on failure
  123.  
  124. int chmod (path,mode)
  125.    char *path;    /* (r) file specification */
  126.    int mode;      /* (r) new access permission */
  127.  
  128. CHOWN
  129.  
  130. C
  131.  
  132. SYSTEM
  133.  
  134. change owner and group of a file
  135.  
  136. 0 on success, non-zero on failure
  137.  
  138. int chown (path,owner,group)
  139.    char *path;    /* (r) file specification */
  140.    uid_t owner;   /* (r) numeric owner id */
  141.    gid_t group;   /* (r) numeric group id */
  142.  
  143. CLOSE
  144.  
  145. C
  146.  
  147. UNIX I/O
  148.  
  149. close a file descriptor
  150.  
  151. 0 on success, non-zero on failure
  152.  
  153. int close(fildes)
  154.    int fildes;    /* (r) file descriptor to close */
  155.  
  156. CREAT
  157.  
  158. C
  159.  
  160. UNIX I/O
  161.  
  162. create a new file or rewrite an existing one
  163.  
  164. Upon successful completion, a non-negative integer, namely the file
  165. descriptor, is returned.  Otherwise, a value of -1 is returned, and
  166. errno is set to indicate the error.
  167.  
  168. int creat (path,mode)
  169.    char *path;    /* (r) name of new file */
  170.    int mode;      /* (r) file mode permissions */
  171.  
  172. DUP
  173.  
  174. C
  175.  
  176. UNIX I/O
  177.  
  178. duplicate an open file descriptor
  179.  
  180. Upon successful completion a non-negative integer, namely the file
  181. descriptor, is returned.  Otherwise, a value of -1 is returned, and
  182. errno is set to indicate the error.
  183.  
  184. int dup (fildes)
  185.    int fildes;    /* (r) the file descriptor to duplicate */
  186.  
  187. EXECL
  188.  
  189. C
  190.  
  191. SUB-PROCESS
  192.  
  193. execute a file
  194.  
  195. If exec returns to the calling process, an error has occurred; the
  196. return value will be -1 and errno will be set to indicate the error.
  197.  
  198. int execl(path,arg0,arg1,...,argn,(char *)0)
  199.    char *path,*arg0,*arg1,...,*argn;
  200.  
  201. EXECV
  202.  
  203. C
  204.  
  205. SUB-PROCESS
  206.  
  207. execute a file
  208.  
  209. If exec returns to the calling process, an error has occurred; the
  210. return value will be -1 and errno will be set to indicate the error.
  211.  
  212. int execv(path,argv)
  213.    char *path,*argv[ ];
  214.  
  215. EXECLE
  216.  
  217. C
  218.  
  219. SUB-PROCESS
  220.  
  221. execute a file
  222.  
  223. If exec returns to the calling process, an error has occurred; the
  224. return value will be -1 and errno will be set to indicate the error.
  225.  
  226. int execle(path,arg0,arg1,...,argn,(char *)0,envp)
  227.    char *path,*arg0,*arg1,...,*argn,*envp[ ];
  228.  
  229. EXECVE
  230.  
  231. C
  232.  
  233. SUB-PROCESS
  234.  
  235. execute a file
  236.  
  237. If exec returns to the calling process, an error has occurred; the
  238. return value will be -1 and errno will be set to indicate the error.
  239.  
  240. int execve(path,argv,envp)
  241.    char *path,*argv[ ],*envp[ ];
  242.  
  243. EXECLP
  244.  
  245. C
  246.  
  247. SUB-PROCESS
  248.  
  249. execute a file
  250.  
  251. If exec returns to the calling process, an error has occurred; the
  252. return value will be -1 and errno will be set to indicate the error.
  253.  
  254. int execlp(file,arg0,arg1,...,argn,(char *)0)
  255.    char *file,*arg0,*arg1,...,*argn;
  256.  
  257. EXECVP
  258.  
  259. C
  260.  
  261. SUB-PROCESS
  262.  
  263. execute a file
  264.  
  265. If exec returns to the calling process, an error has occurred; the
  266. return value will be -1 and errno will be set to indicate the error.
  267.  
  268. int execvp(file,argv)
  269.    char *file,*argv[ ];
  270.  
  271. EXIT
  272.  
  273. C
  274.  
  275. SYSTEM
  276.  
  277. terminate process
  278.  
  279. There can be no return from an exit system call.
  280.  
  281. void exit (status)
  282.    int status;
  283. void _exit (status)
  284.    int status;
  285.  
  286. FCNTL
  287.  
  288. C
  289.  
  290. UNIX I/O
  291.  
  292. file control
  293.  
  294. Upon successful completion, the value returned depends on cmd as
  295. follows:
  296.    F_DUPFD   A new file descriptor.
  297.    F_GETFD   Value of flag (only the low-order bit is defined).
  298.    F_SETFD   Value other than -1.
  299.    F_GETFL   Value of file flags.
  300.    F_SETFL   Value other than -1.
  301.    F_GETLK   Value other than -1.
  302.    F_SETLK   Value other than -1.
  303.    F_SETLKW  Value other than -1.
  304.  
  305. Otherwise, a value of -1 is returned, and errno is set to indicate
  306. the error.
  307.  
  308. int fcntl(fildes,cmd,arg)
  309.    int   fildes,  /* (r) open file descriptor */
  310.          cmd;     /* (r) fcntl option select */
  311.    void  *arg;    /* (r/w) optional argument */
  312.  
  313. FORK
  314.  
  315. C
  316.  
  317. SUB-PROCESS
  318.  
  319. create a new process
  320.  
  321. Upon successful completion, fork returns a value of 0 to the child
  322. process and returns the process ID of the child pro- cess to the
  323. parent process.  Otherwise, a value of -1 is returned to the parent
  324. process, no child process is created, and errno is set to indicate
  325. the error.
  326.  
  327. int fork()
  328.  
  329. GETPID
  330.  
  331. C
  332.  
  333. SYSTEM
  334.  
  335. get process id
  336.  
  337. the process ID of the calling process
  338.  
  339. int getpid()
  340.  
  341. GETPGRP
  342.  
  343. C
  344.  
  345. SYSTEM
  346.  
  347. get process group id
  348.  
  349. the process group ID of the calling process
  350.  
  351. int getpgrp()
  352.  
  353. GETPPID
  354.  
  355. C
  356.  
  357. SYSTEM
  358.  
  359. get parent process id
  360.  
  361. the parent process ID of the calling process
  362.  
  363. int getppid()
  364.  
  365. GETUID
  366.  
  367. C
  368.  
  369. SYSTEM
  370.  
  371. get real user id
  372.  
  373. the real user ID of the calling process
  374.  
  375. int getuid()
  376.  
  377. GETEUID
  378.  
  379. C
  380.  
  381. SYSTEM
  382.  
  383. get effective user id
  384.  
  385. the effective user ID of the calling process
  386.  
  387. int geteuid()
  388.  
  389. GETGID
  390.  
  391. C
  392.  
  393. SYSTEM
  394.  
  395. get real group id
  396.  
  397. the real group ID of the calling process
  398.  
  399. int getgid()
  400.  
  401. GETEGID
  402.  
  403. C
  404.  
  405. SYSTEM
  406.  
  407. get effective group id
  408.  
  409. the effective group ID of the calling process
  410.  
  411. int getegid()
  412.  
  413. IOCTL
  414.  
  415. C
  416.  
  417. SYSTEM
  418.  
  419. control device
  420.  
  421. Upon successful completion, the value returned depends upon the
  422. device control function, but must be a non-negative integer.
  423. Otherwise, a value of -1 is returned, and errno is set to indicate
  424. the error.
  425.  
  426. int ioctl(fildes,request,arg)
  427.    int   fildes,     /* (r) open file descriptor */
  428.          request;    /* (r) ioctl() option selector */
  429.    void  *arg;       /* (r/w) optional argument(s) */
  430.  
  431. KILL
  432.  
  433. C
  434.  
  435. SYSTEM
  436.  
  437. send a signal to a process or a group of processes
  438.  
  439. Upon successful completion, a value of 0 is returned.  Otherwise, a
  440. value of -1 is returned, and errno is set to indicate the error.
  441.  
  442. int kill (pid,sig)
  443. int   pid,     /* (r) process id to receive signal */
  444.       sig;     /* (r) signal */
  445.  
  446. LSEEK
  447.  
  448. C
  449.  
  450. SYSTEM
  451.  
  452. move read/write file pointer
  453.  
  454. Upon successful completion, a non-negative integer indicating the file
  455. pointer value is returned. Otherwise, a value of -1 is returned, and
  456. errno is set to indicate the error.
  457.  
  458. long lseek (fildes,offset,whence)
  459.    int   fildes;     /* (r) Unix i/o file descriptor */
  460.    long  offset;     /* (r)
  461.    int   whence;
  462.  
  463. MKDIR
  464.  
  465. C
  466.  
  467. SYSTEM
  468.  
  469. make a directory
  470.  
  471. Upon successful completion, a value of 0 is returned.  Otherwise, a
  472. value of -1 is returned, and errno is set to indicate the error.
  473.  
  474. int mkdir (path,mode)
  475.    char *path;    /* (r) name of new directory */
  476.    int   mode;    /* (r) permissions */
  477.  
  478. NICE
  479.  
  480. C
  481.  
  482. SYSTEM
  483.  
  484. change priority of a process
  485.  
  486. Upon successful completion, nice returns the new nice value minus
  487. 20.  Otherwise, a value of -1 is returned, and errno is set to
  488. indicate the error.
  489.  
  490. int nice(incr)
  491.    int incr;   /* (r) amount to adjust priority */
  492.  
  493. OPEN
  494.  
  495. C
  496.  
  497. SYSTEM
  498.  
  499. open for reading or writing
  500.  
  501. Upon successful completion, the file descriptor is returned.
  502. Otherwise, a value of -1 is returned, and errno is set to indicate
  503. the error.
  504.  
  505. int open(path,oflag[,mode])
  506.    char  *path;      /* (r) path to device or file */
  507.    int   oflag,      /* (r) file mode */
  508.          mode;       /* (r) initial permissions */
  509.  
  510. PIPE
  511.  
  512. C
  513.  
  514. SYSTEM
  515.  
  516. create an interprocess channel
  517.  
  518. Upon successful completion, a value of 0 is returned.  Otherwise, a
  519. value of -1 is returned, and errno is set to indicate the error.
  520.  
  521. int pipe(fildes)
  522.    int fildes[2]; /* fildes[0]/read, fildes[1]/write */
  523.  
  524. READ
  525.  
  526. C
  527.  
  528. SYSTEM
  529.  
  530. read from file
  531.  
  532. Upon successful completion a non-negative integer is returned
  533. indicating the number of bytes actually read.  Otherwise, a -1 is
  534. returned, and errno is set to indicate the error.
  535.  
  536. int read (fildes, buf, nbyte)
  537.    int fildes;       /* (r) open file descriptor */
  538.    char *buf;        /* (w) receiving buffer */
  539.    unsigned nbyte;   /* (r) number of bytes to read */
  540.  
  541. RENAME
  542.  
  543. C
  544.  
  545. SYSTEM
  546.  
  547. change the name of a file
  548.  
  549. Upon successful completion, a value of 0 is returned. Otherwise, a
  550. value of -1 is returned, and errno is set to indicate the error.
  551.  
  552. int rename (old,  new)
  553.    char *old;  /* (r) old name */
  554.    char *new;  /* (r) new name */
  555.  
  556. RMDIR
  557.  
  558. C
  559.  
  560. SYSTEM
  561.  
  562. remove a directory
  563.  
  564. Upon successful completion, a value of 0 is returned.  Otherwise, a
  565. value of -1 is returned, and errno is set to indicate the error.
  566.  
  567. int rmdir (path)
  568.    char *path;    /* (r) name of directory */
  569.  
  570. SIGNAL
  571.  
  572. C
  573.  
  574. SYSTEM
  575.  
  576. specify what to do upon receipt of a signal
  577.  
  578. Upon successful completion, signal returns the previous value of func
  579. for the specified signal sig.  Otherwise, a value of SIG_ERR is
  580. returned and errno is set to indicate the error.  SIG_ERR is defined
  581. in the include file signal.h.
  582.  
  583. void (*signal(sig,func))()
  584.    int   sig;
  585.    void  (*func)();
  586.  
  587. FSTAT
  588.  
  589. C
  590.  
  591. SYSTEM
  592.  
  593. get open file status
  594.  
  595. Upon successful completion a value of 0 is returned.  Otherwise, a
  596. value of -1 is returned, and errno is set to indicate the error.
  597.  
  598. int fstat (fildes,buf)
  599.    int fildes;       /* (r) file spec */
  600.    struct stat *buf; /* (w) file information */
  601.  
  602. STAT
  603.  
  604. C
  605.  
  606. SYSTEM
  607.  
  608. get file status
  609.  
  610. Upon successful completion a value of 0 is returned.  Otherwise, a
  611. value of -1 is returned, and errno is set to indicate the error.
  612.  
  613. int stat (path,buf)
  614.    char *path;       /* (r) file spec */
  615.    struct stat *buf; /* (w) file information */
  616.  
  617. TIME
  618.  
  619. C
  620.  
  621. SYSTEM
  622.  
  623. get time
  624.  
  625. Upon successful completion, time returns the value of time.
  626. Otherwise, a value of -1 is returned, and errno is set to indicate
  627. the error.
  628.  
  629. time_t time(tloc)
  630.    long *tloc; /* (w) time value */
  631.  
  632. UMASK
  633.  
  634. C
  635.  
  636. SYSTEM
  637.  
  638. set and get file creation mask
  639.  
  640. The previous value of the file mode creation mask is returned.
  641.  
  642. int umask (cmask)
  643.    int cmask;     /* (r) mask */
  644.  
  645. UNLINK
  646.  
  647. C
  648.  
  649. SYSTEM
  650.  
  651. remove directory entry
  652.  
  653. Upon successful completion, a value of 0 is returned.  Otherwise, a
  654. value of -1 is returned, and errno is set to indicate the error.
  655.  
  656. int unlink (path)
  657.    char *path;    /* (r) file specification */
  658.  
  659. UTIME
  660.  
  661. C
  662.  
  663. SYSTEM
  664.  
  665. set file access and modification times
  666.  
  667. Upon successful completion, a value of 0 is returned.  Otherwise, a
  668. value of -1 is returned, and errno is set to indicate the error.
  669.  
  670. int utime (path,times)
  671.    char *path;             /* (r) file spec. */
  672.    struct utimbuf *times;  /* (r) time structure */
  673.  
  674. WAIT
  675.  
  676. C
  677.  
  678. SYSTEM
  679.  
  680. wait for child process to stop or terminate
  681.  
  682. If wait returns due to the receipt of a signal, a value of -1 is
  683. returned to the calling process, and errno is set to EINTR.  If wait
  684. returns due to a stopped or terminated child process, the process ID
  685. of the child is returned to the calling process.  Otherwise, a value
  686. of -1 is returned, and errno is set to indicate the error.
  687.  
  688. int wait(stat_loc)
  689.    int *stat_loc;       /* (w) status of sub-process */
  690.  
  691. WRITE
  692.  
  693. C
  694.  
  695. SYSTEM
  696.  
  697. write on a file
  698.  
  699. Upon successful completion the number of bytes actually written is
  700. returned.  Otherwise, -1 is returned, and errno is set to indicate
  701. the error.
  702.  
  703. int write (fildes,buf,nbyte)
  704.    int fildes;       /* (r) open file descriptor */
  705.    char *buf;        /* (r) buffer */
  706.    unsigned nbyte;   /* (r) number of bytes to write */
  707.  
  708. ABS
  709.  
  710. C
  711.  
  712. MATH
  713.  
  714. return integer absolute value
  715.  
  716. the absolute value of its integer operand
  717.  
  718. int abs(i)
  719.    int i;   /* (r) the integer to convert */
  720.  
  721. ASSERT
  722.  
  723. C
  724.  
  725. DIAGNOSTICS
  726.  
  727. verify program assertion
  728.  
  729. doesn't
  730.  
  731. assert (expression)
  732.    int expression;      /* (r) expression to evaluate */
  733.  
  734. BSEARCH
  735.  
  736. C
  737.  
  738. SEARCHING
  739.  
  740. binary search a sorted table
  741.  
  742. A NULL pointer is returned if the key cannot be found in the table.
  743.  
  744. char *bsearch((char *) key,(char *) base,nel,sizeof(*key),compar)
  745.    unsigned nel;
  746.    int (*compar)( );
  747.  
  748. CTIME
  749.  
  750. C
  751.  
  752. DATE/TIME
  753.  
  754. Convert binary time to an ASCII string
  755.  
  756. ctime returns a pointer to a 26-character string in the following
  757. form. All the fields have constant width.
  758.  
  759.    Fri Sep 13 00:00:00 1986\n\0
  760.  
  761. char *ctime(clock)
  762.    time_t *clock;
  763.  
  764. LOCALTIME
  765.  
  766. C
  767.  
  768. DATE/TIME
  769.  
  770. convert binary Unix time to time structure
  771.  
  772. localtime returns a pointer to a ``tm'' structure
  773.  
  774. struct tm *localtime(clock)
  775.    time_t *clock;
  776.  
  777. GMTIME
  778.  
  779. C
  780.  
  781. DATE/TIME
  782.  
  783. convert binary Unix time to time structure
  784.  
  785. a pointer to a ``tm'' structure
  786.  
  787. struct tm *gmtime(clock)
  788.    time_t *clock;
  789.  
  790. ASCTIME
  791.  
  792. C
  793.  
  794. DATE/TIME
  795.  
  796. convert to string time from the time structure
  797.  
  798. a pointer to the ASCII string
  799.  
  800. char *asctime(tm)
  801.    struct tm *tm;
  802.  
  803. ISDIGIT
  804.  
  805. C
  806.  
  807. CHARACTER TEST
  808.  
  809. test for the digits 0 through 9
  810.  
  811. nonzero for true, zero for false.
  812.  
  813. isdigit(ch)
  814.    int   ch;   /* (r) character to test */
  815.  
  816. ISXDIGIT
  817.  
  818. C
  819.  
  820. CHARACTER TEST
  821.  
  822. Test for hex digit
  823.  
  824. nonzero for true, zero for false.
  825.  
  826. isxdigit(ch)
  827.    int   ch;   /* (r) character to test */
  828.  
  829. ISLOWER
  830.  
  831. C
  832.  
  833. CHARACTER TEST
  834.  
  835. test for lower case character
  836.  
  837. nonzero for true, zero for false.
  838.  
  839. islower(ch)
  840.    int   ch;   /* (r) character to test */
  841.  
  842. ISUPPER
  843.  
  844. C
  845.  
  846. CHARACTER TEST
  847.  
  848. test for upper case character
  849.  
  850. nonzero for true, zero for false.
  851.  
  852. isupper(ch)
  853.    int   ch;   /* (r) character to test */
  854.  
  855. ISALPHA
  856.  
  857. C
  858.  
  859. CHARACTER TEST
  860.  
  861. test for alphabetic character
  862.  
  863. nonzero for true, zero for false.
  864.  
  865. isalpha(ch)
  866.    int   ch;   /* (r) character to test */
  867.  
  868. ISALNUM
  869.  
  870. C
  871.  
  872. CHARACTER TEST
  873.  
  874. test for alphanumeric character
  875.  
  876. nonzero for true, zero for false.
  877.  
  878. isalnum(ch)
  879.    int   ch;   /* (r) character to test */
  880.  
  881. ISSPACE
  882.  
  883. C
  884.  
  885. CHARACTER TEST
  886.  
  887. test for character that generates printed space
  888.  
  889. nonzero for true, zero for false.
  890.  
  891. isspace(ch)
  892.    int   ch;   /* (r) character to test */
  893.  
  894. ISCNTRL
  895.  
  896. C
  897.  
  898. CHARACTER TEST
  899.  
  900. test for control character
  901.  
  902. nonzero for true, zero for false.
  903.  
  904. iscntrl(ch)
  905.    int   ch;   /* (r) character to test */
  906.  
  907. ISPUNCT
  908.  
  909. C
  910.  
  911. CHARACTER TEST
  912.  
  913. test for punctuation character
  914.  
  915. nonzero for true, zero for false.
  916.  
  917. ispunct(ch)
  918.    int   ch;   /* (r) character to test */
  919.  
  920. ISPRINT
  921.  
  922. C
  923.  
  924. CHARACTER TEST
  925.  
  926. test for character that is printable including space
  927.  
  928. nonzero for true, zero for false.
  929.  
  930. isprint(ch)
  931.    int   ch;   /* (r) character to test */
  932.  
  933. ISGRAPH
  934.  
  935. C
  936.  
  937. CHARACTER TEST
  938.  
  939. test for character that is printable excluding space
  940.  
  941. nonzero for true, zero for false.
  942.  
  943. isgraph(ch)
  944.    int   ch;   /* (r) character to test */
  945.  
  946. ISASCII
  947.  
  948. C
  949.  
  950. CHARACTER TEST
  951.  
  952. test for character contained in ASCII character set
  953.  
  954. nonzero for true, zero for false.
  955.  
  956. isascii(ch)
  957.    int   ch;   /* (r) character to test */
  958.  
  959. TOLOWER
  960.  
  961. C
  962.  
  963. CHARACTER CONVERSION
  964.  
  965. convert character to lower case
  966.  
  967. nonzero for true, zero for false.
  968.  
  969. tolower(ch)
  970.    int   ch;   /* (r) character to convert */
  971.  
  972. TOUPPER
  973.  
  974. C
  975.  
  976. CHARACTER CONVERSION
  977.  
  978. convert character to upper case
  979.  
  980. the character converted to upper case
  981.  
  982. toupper(ch)
  983.    int   ch;   /* (r) character to convert */
  984.  
  985. TOASCII
  986.  
  987. C
  988.  
  989. CHARACTER CONVERSION
  990.  
  991. converts a character to ASCII
  992.  
  993. the converted character as an integer
  994.  
  995. toascii(ch)
  996.    int   ch;   /* (r) character to convert */
  997.  
  998. CUSERID
  999.  
  1000. C
  1001.  
  1002. SYSTEM
  1003.  
  1004. get character login name of the user
  1005.  
  1006. If the login name cannot be found, cuserid returns a NULL pointer; if
  1007. s is not a NULL pointer, a null character (\0) will be placed at
  1008. s[0].
  1009.  
  1010. char *cuserid (s)
  1011.    char *s; /* (w) buffer for name */
  1012.  
  1013. DUP2
  1014.  
  1015. C
  1016.  
  1017. UNIX I/O
  1018.  
  1019. duplicate an open file descriptor
  1020.  
  1021. Upon successful completion a non-negative integer, namely the file
  1022. descriptor, is returned.  Otherwise, a value of -1 is returned, and
  1023. errno is set to indicate the error.
  1024.  
  1025. int dup2 (fildes,fildes2)
  1026.    int   fildes,     /* (r) current file descriptor */
  1027.          fildes2;    /* (r) new file descriptor */
  1028.  
  1029. ECVT
  1030.  
  1031. C
  1032.  
  1033. CONVERSION
  1034.  
  1035. convert floating-point number to string
  1036.  
  1037. a pointer to the converted string
  1038.  
  1039. char *ecvt(value,ndigit,decpt,sign)
  1040.    double   value;
  1041.    int      ndigit,
  1042.             *decpt,
  1043.             *sign;
  1044.  
  1045. FCVT
  1046.  
  1047. C
  1048.  
  1049. CONVERSION
  1050.  
  1051. convert floating-point number to string
  1052.  
  1053. a pointer to the converted string
  1054.  
  1055. char *fcvt(value,ndigit,decpt,sign)
  1056.    double   value;
  1057.    int      ndigit,
  1058.             *decpt,
  1059.             *sign;
  1060.  
  1061. GCVT
  1062.  
  1063. C
  1064.  
  1065. CONVERSION
  1066.  
  1067. convert floating-point number to string
  1068.  
  1069. a pointer to the converted string
  1070.  
  1071. char *gcvt(value,ndigit,buf)
  1072.    double   value;
  1073.    int      ndigit;
  1074.    char     *buf;
  1075.  
  1076. EXP
  1077.  
  1078. C
  1079.  
  1080. MATH
  1081.  
  1082. calculate exponent
  1083.  
  1084. the exponent of x
  1085.  
  1086. double exp(x)
  1087.    double x;
  1088.  
  1089. LOG
  1090.  
  1091. C
  1092.  
  1093. MATH
  1094.  
  1095. calculate log
  1096.  
  1097. the log of x
  1098.  
  1099. double log(x)
  1100.    double x;
  1101.  
  1102. LOG10
  1103.  
  1104. C
  1105.  
  1106. MATH
  1107.  
  1108. calculate log10
  1109.  
  1110. log10 of x
  1111.  
  1112. double log10(x)
  1113.    double x;
  1114.  
  1115. POW
  1116.  
  1117. C
  1118.  
  1119. MATH
  1120.  
  1121. calculate power
  1122.  
  1123. the power of xy
  1124.  
  1125. double pow(x,y)
  1126.    double x,y;
  1127.  
  1128. SQRT
  1129.  
  1130. C
  1131.  
  1132. MATH
  1133.  
  1134. calculate square root
  1135.  
  1136. the square root of x
  1137.  
  1138. double sqrt(x)
  1139.    double x;
  1140.  
  1141. FCLOSE
  1142.  
  1143. C
  1144.  
  1145. STANDARD I/O
  1146.  
  1147. close a stream
  1148.  
  1149. 0 for success and EOF if any error (such as trying to write to a file
  1150. that has not been opened for writing) was detected.
  1151.  
  1152. int fclose(stream)
  1153.    FILE *stream;
  1154.  
  1155. FFLUSH
  1156.  
  1157. C
  1158.  
  1159. STANDARD I/O
  1160.  
  1161. flush a stream
  1162.  
  1163. 0 for success and EOF if any error (such as trying to write to a file
  1164. that has not been opened for writing) was detected.
  1165.  
  1166. int fflush(stream)
  1167.    FILE *stream;
  1168.  
  1169. FERROR
  1170.  
  1171. C
  1172.  
  1173. STANDARD I/O
  1174.  
  1175. check for an i/o error on a stream
  1176.  
  1177. error status
  1178.  
  1179. int ferror(stream)
  1180.    FILE *stream;
  1181.  
  1182. FEOF
  1183.  
  1184. C
  1185.  
  1186. STANDARD I/O
  1187.  
  1188. check for an EOF on a stream
  1189.  
  1190. EOF status
  1191.  
  1192. int feof(stream)
  1193.    FILE *stream;
  1194.  
  1195. CLEARERR
  1196.  
  1197. C
  1198.  
  1199. STANDARD I/O
  1200.  
  1201. reset the EOF and error status on a stream
  1202.  
  1203. void
  1204.  
  1205. void clearerr(stream)
  1206.    FILE *stream;
  1207.  
  1208. FILENO
  1209.  
  1210. C
  1211.  
  1212. STANDARD I/O
  1213.  
  1214. get the file descriptor for a file pointer
  1215.  
  1216. a file descriptor
  1217.  
  1218. int fileno(stream)
  1219.    FILE *stream;
  1220.  
  1221. FLOOR
  1222.  
  1223. C
  1224.  
  1225. MATH
  1226.  
  1227. calculate largest integer less than another double
  1228.  
  1229. the largest integer
  1230.  
  1231. double floor(x)
  1232.    double x;
  1233.  
  1234. CEIL
  1235.  
  1236. C
  1237.  
  1238. MATH
  1239.  
  1240. calculate smallest integer greater than another double
  1241.  
  1242. smallest integer
  1243.  
  1244. double ceil(x)
  1245.    double x;
  1246.  
  1247. FMOD
  1248.  
  1249. C
  1250.  
  1251. MATH
  1252.  
  1253. calculate floting-point remainder
  1254.  
  1255. remainder
  1256.  
  1257. double fmod(x,y)
  1258.    double x, y;
  1259.  
  1260. FABS
  1261.  
  1262. C
  1263.  
  1264. MATH
  1265.  
  1266. calculate floating-point absolute value
  1267.  
  1268. absolute value
  1269.  
  1270. double fabs(x)
  1271.    double x;
  1272.  
  1273. FOPEN
  1274.  
  1275. C
  1276.  
  1277. STANDARD I/O
  1278.  
  1279. open a stream
  1280.  
  1281. NULL on failure
  1282.  
  1283. FILE *fopen(filename,type)
  1284.    char  *filename,
  1285.          *type;
  1286.  
  1287. FREOPEN
  1288.  
  1289. C
  1290.  
  1291. STANDARD I/O
  1292.  
  1293. reopen a stream
  1294.  
  1295. NULL on failure
  1296.  
  1297. FILE *freopen(filename,type,stream)
  1298.    char  *filename,
  1299.          *type;
  1300.    FILE  *stream;
  1301.  
  1302. FDOPEN
  1303.  
  1304. C
  1305.  
  1306. STANDARD I/O
  1307.  
  1308. open a stream associated with a file descriptor
  1309.  
  1310. NULL on failure
  1311.  
  1312. FILE *fdopen(fildes,type)
  1313.    int   fildes;
  1314.    char  *type;
  1315.  
  1316. FREAD
  1317.  
  1318. C
  1319.  
  1320. STANDARD I/O
  1321.  
  1322. binary read from a stream
  1323.  
  1324. the number of items read.  If nitems is non-positive, no characters
  1325. are read, and 0 is returned
  1326.  
  1327. int fread(ptr,size,nitems,stream)
  1328.    char     *ptr;
  1329.    int      nitems;
  1330.    size_t   size;
  1331.    FILE     *stream;
  1332.  
  1333. FWRITE
  1334.  
  1335. C
  1336.  
  1337. STANDARD I/O
  1338.  
  1339. binary write to a stream
  1340.  
  1341. the number of items written.  If nitems is non-positive, no
  1342. characters are written, and 0 is returned fwrite.
  1343.  
  1344. int fwrite(ptr,size,nitems,stream)
  1345.    char     *ptr;
  1346.    int      nitems;
  1347.    size_t   size;
  1348.    FILE     *stream;
  1349.  
  1350. FSEEK
  1351.  
  1352. C
  1353.  
  1354. STANDARD I/O
  1355.  
  1356. reposition a stream
  1357.  
  1358. 0 on success, non-zero for improper seeks
  1359.  
  1360. int fseek(stream,offset,ptrname)
  1361.    FILE  *stream;
  1362.    long  offset;
  1363.    int   ptrname;
  1364.  
  1365. REWIND
  1366.  
  1367. C
  1368.  
  1369. STANDARD I/O
  1370.  
  1371. reposition a stream to the beginning
  1372.  
  1373. void
  1374.  
  1375. void rewind(stream)
  1376.    FILE  *stream;
  1377.  
  1378. FTELL
  1379.  
  1380. C
  1381.  
  1382. STANDARD I/O
  1383.  
  1384. get current file position on a stream
  1385.  
  1386. the current file position
  1387.  
  1388. long ftell(stream)
  1389.    FILE  *stream;
  1390.  
  1391. GETC
  1392.  
  1393. C
  1394.  
  1395. STANDARD I/O
  1396.  
  1397. read a character on a stream
  1398.  
  1399. EOF at end-of-file or upon an error
  1400.  
  1401. int getc(stream)
  1402.    FILE *stream;
  1403.  
  1404. GETCHAR
  1405.  
  1406. C
  1407.  
  1408. STANDARD I/O
  1409.  
  1410. read a character from standard input
  1411.  
  1412. EOF at end-of-file or upon an error
  1413.  
  1414. int getchar()
  1415.  
  1416. FGETC
  1417.  
  1418. C
  1419.  
  1420. STANDARD I/O
  1421.  
  1422. read a character from a stream
  1423.  
  1424. EOF at end-of-file or upon an error
  1425.  
  1426. int fgetc(stream)
  1427.    FILE *stream;
  1428.  
  1429. GETW
  1430.  
  1431. C
  1432.  
  1433. STANDARD I/O
  1434.  
  1435. read the next word on a stream
  1436.  
  1437. EOF at end-of-file or upon an error
  1438. Because EOF is a valid integer, ferror() should be used to detect getw
  1439. errors.
  1440.  
  1441. int getw(stream)
  1442.    FILE *stream;
  1443.  
  1444. GETCWD
  1445.  
  1446. C
  1447.  
  1448. SYSTEM
  1449.  
  1450. get path name of current working directory
  1451.  
  1452. Returns NULL with errno set if size is not large enough, or if an
  1453. error occurs in a lower-level function.
  1454.  
  1455. char *getcwd(buf,size)
  1456.    char  *buf;
  1457.    int   size;
  1458.  
  1459. GETENV
  1460.  
  1461. C
  1462.  
  1463. SYSTEM
  1464.  
  1465. return value for environment name
  1466.  
  1467. a pointer to the string or NULL on failure
  1468.  
  1469. char *getenv (name)
  1470.    char *name;
  1471.  
  1472. GETS
  1473.  
  1474. C
  1475.  
  1476. STANDARD I/O
  1477.  
  1478. read a string from standard input
  1479.  
  1480. the string on success, NULL on failure
  1481.  
  1482. char *gets(s)
  1483.    char *s;
  1484.  
  1485. FGETS
  1486.  
  1487. C
  1488.  
  1489. STANDARD I/O
  1490.  
  1491. read a string from a stream
  1492.  
  1493. the string on success, NULL on failure
  1494.  
  1495. char *fgets(s,n,stream)
  1496.    char *s;
  1497.    int n;
  1498.    FILE *stream;
  1499.  
  1500. LOCKF
  1501.  
  1502. C
  1503.  
  1504. UNIX I/O
  1505.  
  1506. record locking on files
  1507.  
  1508. Upon successful completion, a value of 0 is returned.  Oth- erwise, a
  1509. value of -1 is returned and errno is set to indi- cate the error.
  1510.  
  1511. int lockf(fildes,function,size)
  1512.    long  size;
  1513.    int   fildes,
  1514.          function;
  1515.  
  1516. MALLOC
  1517.  
  1518. C
  1519.  
  1520. MEMORY ALLOCATION
  1521.  
  1522. allocate memory
  1523.  
  1524. a pointer to allocated memory or NULL on failure
  1525.  
  1526. char *malloc(size)
  1527.    unsigned size;
  1528.  
  1529. FREE
  1530.  
  1531. C
  1532.  
  1533. MEMORY ALLOCATION
  1534.  
  1535. free allocated memory
  1536.  
  1537. void
  1538.  
  1539. void free(ptr)
  1540.    char *ptr;
  1541.  
  1542. REALLOC
  1543.  
  1544. C
  1545.  
  1546. MEMORY ALLOCATION
  1547.  
  1548. reallocate memory
  1549.  
  1550. a pointer to allocated memory or NULL on failure
  1551.  
  1552. char *realloc(ptr,size)
  1553.    char *ptr;
  1554.    unsigned size;
  1555.  
  1556. CALLOC
  1557.  
  1558. C
  1559.  
  1560. MEMORY ALLOCATION
  1561.  
  1562. allocate memory and clear
  1563.  
  1564. a pointer to allocated memory or NULL on failure
  1565.  
  1566. char *calloc(nelem,elsize)
  1567.    unsigned    nelem,
  1568.                elsize;
  1569.  
  1570. MEMCCPY
  1571.  
  1572. C
  1573.  
  1574. MEMORY
  1575.  
  1576. copy memory up to a specified character
  1577.  
  1578. a pointer on success, NULL on failure to find c
  1579.  
  1580. char *memccpy(s1,s2,c,n)
  1581.    char  *s1,
  1582.          *s2;
  1583.    int   c,
  1584.          n;
  1585.  
  1586. MEMCHR
  1587.  
  1588. C
  1589.  
  1590. MEMORY
  1591.  
  1592. find first occurance of a character in a buffer
  1593.  
  1594. the first character or NULL if not found
  1595.  
  1596. char *memchr(s,c,n)
  1597.    char  *s;
  1598.    int   c,
  1599.          n;
  1600.  
  1601. MEMCMP
  1602.  
  1603. C
  1604.  
  1605. MEMORY
  1606.  
  1607. compare buffers
  1608.  
  1609. less than (negative), equal to (0), or greater than (positive)
  1610.  
  1611. int memcmp(s1,s2,n)
  1612.    char  *s1,
  1613.          *s2;
  1614.    int   n;
  1615.  
  1616. MEMCPY
  1617.  
  1618. C
  1619.  
  1620. MEMORY
  1621.  
  1622. copy characters from one buffer to another
  1623.  
  1624. s1
  1625.  
  1626. char *memcpy(s1,s2,n)
  1627.    char  *s1,
  1628.          *s2;
  1629.    int   n;
  1630.  
  1631. MEMSET
  1632.  
  1633. C
  1634.  
  1635. MEMORY
  1636.  
  1637. fill a buffer with a specified character
  1638.  
  1639. s
  1640.  
  1641. char *memset(s,c,n)
  1642.    char  *s;
  1643.    int   c,
  1644.          n;
  1645.  
  1646. MKTEMP
  1647.  
  1648. C
  1649.  
  1650. FILENAME
  1651.  
  1652. make a unique file name
  1653.  
  1654. The address of the string on success, NULL on failure
  1655.  
  1656. char *mktemp(template)
  1657.    char *template;
  1658.  
  1659. PERROR
  1660.  
  1661. C
  1662.  
  1663. ERROR
  1664.  
  1665. display the message for the last error condition
  1666.  
  1667. void
  1668.  
  1669. void perror(s)
  1670.    char *s;
  1671.  
  1672. POPEN
  1673.  
  1674. C
  1675.  
  1676. STANDARD I/O
  1677.  
  1678. open a pipe to a process
  1679.  
  1680. NULL pointer if files or processes cannot be created.
  1681.  
  1682. FILE *popen(command,type)
  1683. char  *command,
  1684.       *type;
  1685.  
  1686. PCLOSE
  1687.  
  1688. C
  1689.  
  1690. STANDARD I/O
  1691.  
  1692. close a pipe to a process
  1693.  
  1694. -1 if stream is not associated with a ``popened'' command.
  1695.  
  1696. int pclose(stream)
  1697. FILE  *stream;
  1698.  
  1699. PRINTF
  1700.  
  1701. C
  1702.  
  1703. STANDARD I/O
  1704.  
  1705. format output to Standard Output
  1706.  
  1707. the number of characters transmitted, or a negative value if an output
  1708. error was encountered.
  1709.  
  1710. int printf(format,arg ... )
  1711.    char *format;
  1712.  
  1713. FPRINTF
  1714.  
  1715. C
  1716.  
  1717. STANDARD I/O
  1718.  
  1719. format output to a stream
  1720.  
  1721. the number of characters transmitted, or a negative value if an
  1722. output error was encountered.
  1723.  
  1724. int fprintf(stream,format,arg ... )
  1725.    FILE  *stream;
  1726.    char  *format;
  1727.  
  1728. SPRINTF
  1729.  
  1730. C
  1731.  
  1732. CONVERSION
  1733.  
  1734. convert to string with various formats
  1735.  
  1736. the number of characters converted (not including the \0), or a
  1737. negative value if a conversion error was encountered.
  1738.  
  1739. int sprintf(s,format[,arg ] ... )
  1740.    char  *s,
  1741.          *format;
  1742.  
  1743. PUTC
  1744.  
  1745. C
  1746.  
  1747. STANDARD I/O
  1748.  
  1749. write a character to a stream
  1750.  
  1751. The value written, or EOF on failure
  1752.  
  1753. int putc(c,stream)
  1754.    int c;
  1755.    FILE *stream;
  1756.  
  1757. PUTCHAR
  1758.  
  1759. C
  1760.  
  1761. STANDARD I/O
  1762.  
  1763. write a character to standard output
  1764.  
  1765. The value written, or EOF on failure
  1766.  
  1767. int putchar(c)
  1768.    int c;
  1769.  
  1770. FPUTC
  1771.  
  1772. C
  1773.  
  1774. STANDARD I/O
  1775.  
  1776. write a character to a stream
  1777.  
  1778. The value written, or EOF on failure
  1779.  
  1780. int fputc(c,stream)
  1781.    int c;
  1782.    FILE *stream;
  1783.  
  1784. PUTW
  1785.  
  1786. C
  1787.  
  1788. STANDARD I/O
  1789.  
  1790. write a word to a stream
  1791.  
  1792. The value written, or EOF on failure (ferror() should be used to
  1793. check for errors.
  1794.  
  1795. int putw(w,stream)
  1796.    int w;
  1797.    FILE *stream;
  1798.  
  1799. PUTENV
  1800.  
  1801. C
  1802.  
  1803. SYSTEM
  1804.  
  1805. change or add value to environment
  1806.  
  1807. non-zero if it was unable to obtain enough space via malloc for an
  1808. expanded environment, otherwise zero.
  1809.  
  1810. int putenv(string)
  1811.    char *string;
  1812.  
  1813. PUTS
  1814.  
  1815. C
  1816.  
  1817. STANDARD I/O
  1818.  
  1819. put a string on Standard Output
  1820.  
  1821. 0 on success, EOF on failure
  1822.  
  1823. int puts(s)
  1824.    char *s;
  1825.  
  1826. FPUTS
  1827.  
  1828. C
  1829.  
  1830. STANDARD I/O
  1831.  
  1832. put a string on a stream
  1833.  
  1834. 0 on success, EOF on failure
  1835.  
  1836. int fputs(s,stream)
  1837.    char *s;
  1838.    FILE *stream;
  1839.  
  1840. QSORT
  1841.  
  1842. C
  1843.  
  1844. SORT
  1845.  
  1846. quicker sort
  1847.  
  1848. void
  1849.  
  1850. void qsort((char *) base,nel,sizeof(*base),compar)
  1851.    unsigned nel;
  1852.    int (*compar)( );
  1853.  
  1854. RAND
  1855.  
  1856. C
  1857.  
  1858. RANDOM NUMBER
  1859.  
  1860. generate a random number
  1861.  
  1862. a random number between 0 and (2^15)-1
  1863.  
  1864. int rand()
  1865.  
  1866. SRAND
  1867.  
  1868. C
  1869.  
  1870. RANDOM NUMBER
  1871.  
  1872. seed the random number generator
  1873.  
  1874. void
  1875.  
  1876. void srand(seed)
  1877.    unsigned seed;
  1878.  
  1879. SCANF
  1880.  
  1881. C
  1882.  
  1883. STANDARD I/O
  1884.  
  1885. convert and format for output to Standard Output
  1886.  
  1887. the number of successfully matched and assigned input items; this
  1888. number can be zero in the event of an early conflict between an input
  1889. character and the control string. If the input ends before the first
  1890. conflict or conversion, EOF is returned.
  1891.  
  1892. int scanf(format [,pointer] ... )
  1893.    char  *format;
  1894.  
  1895. FSCANF
  1896.  
  1897. C
  1898.  
  1899. STANDARD I/O
  1900.  
  1901. convert and format for output to a stream
  1902.  
  1903. EOF on end of input and a short count for missing or illegal data
  1904. items.
  1905.  
  1906. int fscanf(stream,format [,pointer] ... )
  1907.    FILE  *stream;
  1908.    char  *format;
  1909.  
  1910. SSCANF
  1911.  
  1912. C
  1913.  
  1914. CONVERSION
  1915.  
  1916. convert from string to various formats
  1917.  
  1918. EOF on end of input and a short count for missing or illegal data
  1919. items.
  1920.  
  1921. int sscanf(s,format [,pointer] ... )
  1922.    char  *s,
  1923.          *format;
  1924.  
  1925. SETBUF
  1926.  
  1927. C
  1928.  
  1929. STANDARD I/O
  1930.  
  1931. modify standard i/o buffer
  1932.  
  1933. void
  1934.  
  1935. void setbuf(stream,buf)
  1936.    FILE *stream;
  1937.    char *buf;
  1938.  
  1939. SETVBUF
  1940.  
  1941. C
  1942.  
  1943. STANDARD I/O
  1944.  
  1945. modify standard i/o buffer
  1946.  
  1947. non-zero for illegal types or sizes
  1948.  
  1949. int setvbuf(stream,buf,type,size)
  1950.    FILE *stream;
  1951.    char *buf;
  1952.    int type, size;
  1953.  
  1954. SETJMP
  1955.  
  1956. C
  1957.  
  1958. FLOW CONTROL
  1959.  
  1960. non-local goto
  1961.  
  1962. 0
  1963.  
  1964. int setjmp(env)
  1965.    jmp_buf env;
  1966.  
  1967. LONGJMP
  1968.  
  1969. C
  1970.  
  1971. FLOW CONTROL
  1972.  
  1973. non-local goto
  1974.  
  1975. void
  1976.  
  1977. void longjmp(env,val)
  1978.    jmp_buf env;
  1979.    int val;
  1980.  
  1981. SLEEP
  1982.  
  1983. C
  1984.  
  1985. TIMING
  1986.  
  1987. suspend execution for interval
  1988.  
  1989. the unslept amount
  1990.  
  1991. unsigned sleep(seconds)
  1992.    unsigned seconds;
  1993.  
  1994. STRCAT
  1995.  
  1996. C
  1997.  
  1998. STRING
  1999.  
  2000. unbounded string concatenation
  2001.  
  2002. a pointer to the result
  2003.  
  2004. char *strcat(s1,s2)
  2005.    char *s1,*s2;
  2006.  
  2007. STRDUP
  2008.  
  2009. C
  2010.  
  2011. STRING
  2012.  
  2013. duplicate a string
  2014.  
  2015. pointer to duplicated string or NULL on failure
  2016.  
  2017. char *strdup(s1)
  2018.    char *s1;
  2019.  
  2020. STRNCAT
  2021.  
  2022. C
  2023.  
  2024. STRING
  2025.  
  2026. bounded string concatentation
  2027.  
  2028. a pointer to the result
  2029.  
  2030. char *strncat(s1,s2,n)
  2031.    char *s1,*s2;
  2032.    size_t n;
  2033.  
  2034. STRCMP
  2035.  
  2036. C
  2037.  
  2038. STRING
  2039.  
  2040. unbounded string compare
  2041.  
  2042. the compare result
  2043.  
  2044. int strcmp(s1,s2)
  2045.    char *s1,*s2;
  2046.  
  2047. STRNCMP
  2048.  
  2049. C
  2050.  
  2051. STRING
  2052.  
  2053. bounded string compare
  2054.  
  2055. the compare result
  2056.  
  2057. int strncmp(s1,s2,n)
  2058.    char *s1,*s2;
  2059.    size_t n;
  2060.  
  2061. STRCPY
  2062.  
  2063. C
  2064.  
  2065. STRING
  2066.  
  2067. unbounded string copy
  2068.  
  2069. a pointer to the result
  2070.  
  2071. char *strcpy(s1,s2)
  2072.    char *s1,*s2;
  2073.  
  2074. STRNCPY
  2075.  
  2076. C
  2077.  
  2078. STRING
  2079.  
  2080. bounded string copy
  2081.  
  2082. a pointer to the result
  2083.  
  2084. char *strncpy(s1,s2,n)
  2085.    char *s1,*s2;
  2086.    size_t n;
  2087.  
  2088. STRLEN
  2089.  
  2090. C
  2091.  
  2092. STRING
  2093.  
  2094. find the length of a string
  2095.  
  2096. the string length
  2097.  
  2098. int strlen(s)
  2099.    char *s;
  2100.  
  2101. STRCHR
  2102.  
  2103. C
  2104.  
  2105. STRING
  2106.  
  2107. find the first occurance of a character in a string
  2108.  
  2109. the character or NULL if not found
  2110.  
  2111. char *strchr(s,c)
  2112.    char *s;
  2113.    int c;
  2114.  
  2115. STRRCHR
  2116.  
  2117. C
  2118.  
  2119. STRING
  2120.  
  2121. find the last occurance of a character in a string
  2122.  
  2123. the character or NULL if not found
  2124.  
  2125. char *strrchr(s,c)
  2126.    char *s;
  2127.    int c;
  2128.  
  2129. STRPBRK
  2130.  
  2131. C
  2132.  
  2133. STRING
  2134.  
  2135. find a break character in a string
  2136.  
  2137. the string or NULL if it does not exist
  2138.  
  2139. char *strpbrk(s1,s2)
  2140.    char *s1,*s2;
  2141.  
  2142. STRSPN
  2143.  
  2144. C
  2145.  
  2146. STRING
  2147.  
  2148. extract an inclusive segment from a string
  2149.  
  2150. the length of the segment
  2151.  
  2152. int strspn(s1,s2)
  2153.    char *s1,*s2;
  2154.  
  2155. STRCSPN
  2156.  
  2157. C
  2158.  
  2159. STRING
  2160.  
  2161. extract an exclusive segment from a string
  2162.  
  2163. the length of the segment
  2164.  
  2165. int strcspn(s1,s2)
  2166.    char *s1,*s2;
  2167.  
  2168. STRTOK
  2169.  
  2170. C
  2171.  
  2172. STRING
  2173.  
  2174. extract a token from a string
  2175.  
  2176. the token or NULL when no more tokens
  2177.  
  2178. char *strtok(s1,s2)
  2179.    char *s1,*s2;
  2180.  
  2181. STRTOD
  2182.  
  2183. C
  2184.  
  2185. CONVERSION
  2186.  
  2187. convert string numeric to double
  2188.  
  2189. the string converted to double or _HUGE on overflow
  2190.  
  2191. double strtod(str,ptr)
  2192.    char  *str,
  2193.          **ptr;
  2194.  
  2195. ATOF
  2196.  
  2197. C
  2198.  
  2199. CONVERSION
  2200.  
  2201. convert string numeric to float
  2202.  
  2203. the string converted to double or _HUGE on overflow
  2204.  
  2205. double atof(str)
  2206.    char  *str;
  2207.  
  2208. STRTOL
  2209.  
  2210. C
  2211.  
  2212. CONVERSION
  2213.  
  2214. convert string numeric to integer
  2215.  
  2216. the numeric string converted to long
  2217.  
  2218. long strtol(str,ptr,base)
  2219.    char  *str,
  2220.          **ptr;
  2221.    int   base;
  2222.  
  2223. ATOL
  2224.  
  2225. C
  2226.  
  2227. CONVERSION
  2228.  
  2229. convert string numeric to integer
  2230.  
  2231. the string converted to long
  2232.  
  2233. long atol(str)
  2234.    char  *str;
  2235.  
  2236. ATOI
  2237.  
  2238. C
  2239.  
  2240. CONVERSION
  2241.  
  2242. convert string numeric to integer
  2243.  
  2244. an integer converted from string numeric
  2245.  
  2246. int atoi(str)
  2247.    char  *str;
  2248.  
  2249. SWAB
  2250.  
  2251. C
  2252.  
  2253. CONVERSION
  2254.  
  2255. swap bytes
  2256.  
  2257. void
  2258.  
  2259. void swab(from,to,nbytes)
  2260.    char  *from,
  2261.          *to;
  2262.    int   nbytes;
  2263.  
  2264. SYSTEM
  2265.  
  2266. C
  2267.  
  2268. SYSTEM
  2269.  
  2270. issue a command-interpreter command
  2271.  
  2272. the exit status of the command
  2273.  
  2274. int system(command)
  2275.    char  *command;
  2276.  
  2277. TMPFILE
  2278.  
  2279. C
  2280.  
  2281. STANDARD I/O
  2282.  
  2283. create a temporary file
  2284.  
  2285. a FILE pointer or NULL on failures
  2286.  
  2287. FILE *tmpfile()
  2288.  
  2289. TMPNAM
  2290.  
  2291. C
  2292.  
  2293. FILENAME
  2294.  
  2295. create a name for a temporary file
  2296.  
  2297. a pointer to the name or NULL on failure
  2298.  
  2299. char *tmpnam(s)
  2300.    char  *s;
  2301.  
  2302. TEMPNAM
  2303.  
  2304. C
  2305.  
  2306. FILENAME
  2307.  
  2308. create a name for a temporary file
  2309.  
  2310. a pointer to the name or NULL on failure
  2311.  
  2312. char *tempnam(dir,pfx)
  2313.    char  *dir,
  2314.          *pfx;
  2315.  
  2316. SIN
  2317.  
  2318. C
  2319.  
  2320. MATH
  2321.  
  2322. calculate the sine
  2323.  
  2324. the sine in radians
  2325.  
  2326. double sin(x)
  2327.    double x;
  2328.  
  2329. COS
  2330.  
  2331. C
  2332.  
  2333. MATH
  2334.  
  2335. calculate the cosine
  2336.  
  2337. the cosine in radians
  2338.  
  2339. double cos(x)
  2340.    double x;
  2341.  
  2342. TAN
  2343.  
  2344. C
  2345.  
  2346. MATH
  2347.  
  2348. calculate the tangent
  2349.  
  2350. the tangent in radians
  2351.  
  2352. double tan(x)
  2353.    double x;
  2354.  
  2355. ASIN
  2356.  
  2357. C
  2358.  
  2359. MATH
  2360.  
  2361. calculate the arcsine
  2362.  
  2363. the arcsine of x
  2364.  
  2365. double asin(x)
  2366.    double x;
  2367.  
  2368. ACOS
  2369.  
  2370. C
  2371.  
  2372. MATH
  2373.  
  2374. calculate the arccosine
  2375.  
  2376. the arccosine of x
  2377.  
  2378. double acos(x)
  2379.    double x;
  2380.  
  2381. ATAN
  2382.  
  2383. C
  2384.  
  2385. MATH
  2386.  
  2387. calculate the arctangent
  2388.  
  2389. the arctangent of x
  2390.  
  2391. double atan(x)
  2392.    double x;
  2393.  
  2394. ATAN2
  2395.  
  2396. C
  2397.  
  2398. MATH
  2399.  
  2400. calculate the arctangent of y/x
  2401.  
  2402. the arctangent of y/x
  2403.  
  2404. double atan2(y,x)
  2405.    double   y,
  2406.             x;
  2407.  
  2408. ISATTY
  2409.  
  2410. C
  2411.  
  2412. SYSTEM
  2413.  
  2414. determine origin of file descriptor
  2415.  
  2416. 1 if fildes is associated with a terminal device, 0 otherwise.
  2417.  
  2418. int isatty (fildes)
  2419.    int fildes;
  2420.  
  2421. UNGETC
  2422.  
  2423. C
  2424.  
  2425. STANDARD I/O
  2426.  
  2427. push character back into input stream
  2428.  
  2429. ungetc returns EOF if it cannot insert the character.
  2430.  
  2431. int ungetc(c,stream)
  2432.    int c;
  2433.    FILE *stream;
  2434.  
  2435.